[XEN][POWERPC] Fix systemsim-gpul failure to boot
authorJimi Xenidis <jimix@watson.ibm.com>
Tue, 12 Dec 2006 00:43:18 +0000 (19:43 -0500)
committerJimi Xenidis <jimix@watson.ibm.com>
Tue, 12 Dec 2006 00:43:18 +0000 (19:43 -0500)
This patch fixes the fencepost error and adds a check for the failure to
initialize the allocator, which would have make Mark's FTB much easier
to debug.
This works for me on the public systemsim-gpul release.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Also fixes Maple, was just getting luck.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : %87%8C%E1%F7%8A%D3%97oD%A6W%E58j%7Fma%9F%FA%C2

xen/arch/powerpc/boot_of.c

index 26a9ed19ebb1237d363089553c868db9898e98dc..f5d456bf047775f9e0d1c490cde249f9698241d1 100644 (file)
@@ -608,7 +608,7 @@ static ulong boot_of_mem_init(void)
                 if (size_cells == 2 && (r < l) )
                     size = (size << 32) | reg[r++];
                 
-                if (r >= l)
+                if (r > l)
                     break;  /* partial line.  Skip */
 
                 boot_of_alloc_init(p, addr_cells, size_cells);
@@ -1290,6 +1290,7 @@ multiboot_info_t __init *boot_of_init(
 {
     static multiboot_info_t mbi;
     void *oft;
+    int r;
 
     of_vec = vec;
     of_msr = orig_msr;
@@ -1316,7 +1317,9 @@ multiboot_info_t __init *boot_of_init(
     of_printf("%s: _start %p _end %p 0x%lx\n", __func__, _start, _end, r6);
 
     boot_of_fix_maple();
-    boot_of_mem_init();
+    r = boot_of_mem_init();
+    if (r == 0)
+        of_panic("failure to initialize memory allocator");
     boot_of_bootargs(&mbi);
     oft = boot_of_module(r3, r4, &mbi);
     boot_of_cpus();